package org.syncsoft.overalt.gui.impl.tableDataModel;

import java.util.Collection;

import org.apache.commons.lang.StringEscapeUtils;
import org.syncsoft.overalt.domain.user.entity.User;
import org.syncsoft.overalt.gui.api.tableDataModel.AbstractEntityTableDataModel;

/**
 * 
 * @author tptfc
 *
 */
@SuppressWarnings("serial")
public class UserTableDataModel extends AbstractEntityTableDataModel<User> {
	/**
	 * 
	 * @param columnNames
	 * @param entities
	 */
	public UserTableDataModel(Collection<String> columnNames, Collection<User> entities) {
		super(columnNames, entities);
	}
	
	/**
	 * 
	 * @param columnNames
	 * @param entities
	 * @param selectedEntities
	 */
	public UserTableDataModel(Collection<String> columnNames, Collection<User> entities, Collection<User> selectedEntities) {
		super(columnNames, entities, selectedEntities);
	}
	
	/**
	 * 
	 * @param columnNames
	 * @param entities
	 * @param selectedEntities
	 * @param requiredEntities
	 */
	public UserTableDataModel(Collection<String> columnNames, Collection<User> entities, Collection<User> selectedEntities, Collection<User> requiredEntities) {
		super(columnNames, entities, selectedEntities, requiredEntities);
	}

	/*
	 * (non-Javadoc)
	 * @see org.syncsoft.overalt.gui.swing.api.AbstractTableDataModel#getRowItemValue(int, org.syncsoft.overalt.domain.common.entity.IEntity, java.util.Collection)
	 */
	@Override
	public Object getRowItemValue(int column, User entity, Collection<User> selectedEntities) {
		Object value = null;
		
		switch (column) {
			case 1:
				value = StringEscapeUtils.unescapeHtml(entity.getShortName());
		}
		
		return value;
	}
}
